
<%@page import="org.jackysoft.util.*"%>
<%@ page contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<%@ taglib  uri="http://java.sun.com/jstl/core_rt" prefix="c" %>
<%@ taglib  uri="http://www.springframework.org/security/tags" prefix="sec" %>
<%@ taglib  uri="http://java.sun.com/jsp/jstl/fmt" prefix="fmt" %>

<style>
.detail-panel {
	display:block;
}
</style>
<c:set var="ptn" value="######0.0000" />
<c:set var="iptn" value="######0" />
<table class="table table-hover table-bordered table-striped table-condensed ">
<thead>
  <tr>
    <th>
    <button class="btn btn-info"
      onclick="doPost('contract/contract!startquery')"
    >继续查询</button>
    </th>    
    <th></th>
    <th></th>
    <th></th>
  </tr>
  <tr>
    <th>项目名称</th>
    <th>合同总量</th>
    <th>合同笔数</th>    
    <th>月份明细</th>
  </tr>
</thead>
<tbody>
  <c:forEach items="${pager.rows}" var="item">
   
   <tr class="success">
    <td>     
    <span class="label label-inverse">
     ${item.validation}
    </span>      
    </td>
    <td>
      
       <fmt:formatNumber value="${item.amount}" pattern="${ptn}"    />
    </td>
    <td>
     
      <fmt:formatNumber value="${item.counter}" pattern="${iptn}"    />
    </td>   
    <td class="btn-group">   
        <form id="dform">
        	<input type="hidden" name="query.sqlId" value="statAllByDate"/>
        	<input type="hidden" name="query.resultCode" value="detailsOfValidation"/>
    		<input type="hidden" name="query.state" value="START"/>
			<input type="hidden" name="query.fields[0].name" value="a.validation"/>
			<input type="hidden" name="query.fields[0].value" value="${item.validation}"/>
         	<button 
         	  	   class="btn btn-inverse btn-mini"
        		   type="button"
        		   onclick="toggleValidation(this)"
            >
                                   明细
       </button>        
</form>
       
    </td>
   </tr>  
   <%
      Months[] ms = Months.values();
      pageContext.setAttribute("months", ms);
      //Weeks[] ws = Weeks.values();
   %>
  
   <tr class="info">
    
    <td colspan="10" id="panel${item.vid}" class="detail-panel"> 
     <table class="table table-condensed">
     <caption class="label label-inverse">总量</caption>
         <thead>
         <tr> 
          <c:forEach items="${months}" var="m">
            <th>
            <span class="${item[m.name]==0?'':'label label-important'}">
            ${m.label}月
            </span>
            </th>         
          </c:forEach>         
         </tr>  
         </thead>
         <tbody>
           <tr>
              <c:forEach items="${months}" var="m">
            <td>
             <span >
                
                <fmt:formatNumber value="${item[m.name]}" pattern="${ptn}"    />
             </span>             
            </td>         
          </c:forEach> 
           </tr>
           
         </tbody>     
     </table>   
    </td>
    
   </tr>
  </c:forEach>
</tbody>
</table>

<script type="text/javascript" src="scripts/apps/contract/query.js"></script>